<?php

namespace App\command;

use app\common\MsgType;
use App\model\Mail;
use app\model\User;
use App\service\TradeService;
use GatewayWorker\Lib\Gateway;
use support\Constant;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Output\OutputInterface;


class IsOnline extends Command
{
    protected static $defaultName = 'command:isOnline';
    protected static $defaultDescription = 'command isOnline';

    /**
     * @return void
     */
    protected function configure()
    {
        $this->addArgument('uuid', InputArgument::OPTIONAL, 'Name description');
        $this->addArgument('role_id', InputArgument::OPTIONAL, 'Name description');
    }

    /**
     * @param InputInterface $input
     * @param OutputInterface $output
     * @return int
     */
    protected function execute(InputInterface $input, OutputInterface $output): int
    {
        $uuid = $input->getArgument('uuid');
        $role_id = $input->getArgument('role_id');
        // $output->writeln('Hello command:sendLotteryEmail');

        var_dump($uuid, $role_id);
        $real_uuid = $uuid . '-' . $role_id;

        var_dump(Gateway::isUidOnline($real_uuid));


        return self::SUCCESS;

    }

}
